Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSC4071: Pagination Token Headers #4071

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Fizzadar
Copy link
Contributor

@Fizzadar Fizzadar commented Oct 29, 2023

Rendered.

Signed off by Nick @ Beeper (@Fizzadar) [email protected].

Putting this up for discussion prior to doing any implementation work, but should be very quick to implement.

@Fizzadar Fizzadar changed the title [WIP] MSCXXXX: Pagination Token Headers [WIP] MSC4071: Pagination Token Headers Oct 29, 2023
@turt2live turt2live added proposal A matrix spec change proposal client-server Client-Server API kind:maintenance MSC which clarifies/updates existing spec needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. labels Oct 29, 2023
@Fizzadar Fizzadar force-pushed the pagination-token-headers branch from 407b907 to 4efe021 Compare October 29, 2023 19:56
@Fizzadar Fizzadar marked this pull request as ready for review October 29, 2023 19:59
@Fizzadar Fizzadar changed the title [WIP] MSC4071: Pagination Token Headers MSC4071: Pagination Token Headers Oct 29, 2023
change any time soon (if ever). Whether the advantages outweigh the "ugliness" of this hack is up
for discussion here.

## Alternatives
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

matrix-org/matrix-spec#223 is vaguely related and might have some other ideas (and links off to other bits).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha! The one term I didn't search for, preflight :) Linked in alternatives and expanded a bit on things. Essentially I see this MSC as a temporary workaround because it's dead simple to implement, and long run one of the alternatives are the real fix.

Copy link
Contributor

@MTRNord MTRNord left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from my one comment I believe this is a much needed change :)


Servers must treat the values exactly the same as the query string versions.

If a client makes a request specifying both header and query string servers should reject the request
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm I wonder about backwards compatiblity here. If the server doesn't support these headers yet how can a client know about this? Imho it makes sense to allow both to be sent as long as they are identical.

I know this kinda circumvents the point of the proposal however a client could still choose to only send one.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An alternative could be to just have it somewhere in I guess the versions endpoint denoted that a server supports this. Clients request that endpoint usually anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I was thinking this would be indicated to clients via the versions endpoint (but then only included the unstable flag).

Good point about making the switchover, I think specifying both as long as they're the same is reasonable and avoids having to figure out detection.

## Proposal

Super simple - clients may pass pagination tokens as a header instead of query parameters using the
format `X-Matrix-Pagination-$PARAM`, the following table lists the available headers by endpoint:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The X- prefix is deprecated: https://www.rfc-editor.org/rfc/rfc6648 The Matrix- prefix should be enough to ensure that it doesn't collide with any other HTTP headers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client-server Client-Server API kind:maintenance MSC which clarifies/updates existing spec needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. proposal A matrix spec change proposal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants